<template>
    <div class="q-box" v-show="show">{{ msg }}</div>
    <input type="button" value="获取数据" @click="getImgs">
    <input type="button" value="获取数据2" @click="showFn">

    <ul>
        <li v-for="item in list" :key="item.proid">
            {{ item.proname }}
        </li>
    </ul>
</template>

<script>
export default {
    data() {
        return {
            msg: "ddd",
            show: false,
            list: [],
            count: 1,
            person:{
                name:"冷震洋",
                age:18
            }
        }
    },
    created() {
        // let t = true;
        this.count = 20;
        // console.log("t",t);
        // this.show = t;
        // console.log("res.data.data",res.data.data);
        // this.msg = res.data.data;
        // this.show = res.data.data;

    },
    methods: {
        getImgs() {
            // console.log("this.count",this.count);
            this.$http.get("/pro/list", {
                params: {
                    count: this.count,
                    limitNum: 10
                }
            })
                .then(res => {
                    console.log("res.data", res.data);
                    this.list = res.data.data;
                });
        },
        showFn(){
            console.log("this.person.name",this.person.name);
            console.log("this.person",this.person);
            console.log("this.person.book",this.person.book);
            console.log("this.person.book.name",this.person.book.name);
        }
    }
}
</script>

<style scoped>
.q-box {
    width: 100px;
}
</style>